package data

import (
	"fmt"

	"github.com/treelab/updatecolumn/models"
)

type FormulaCellQueryResult struct {
	FormulaColumns []models.Column
}

func GetQueryFormulaString(first, offset int) string {

	return fmt.Sprintf(`
		{
			formulaColumns(func:eq(columnType, "FORMULA"), first:%d, offset:%d) {
				columnType
				cells: has_cell {
					uid
					rowId
				}
				dependentColumns: has_dependent_column {
					cells: has_cell {
						uid
						rowId
					}
				}
			}
		}
	`, first, offset)

}
